]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Also handle dbus service crashes
authorJonas Dreßler <verdre@v0yd.nl>
Wed, 26 Apr 2023 11:27:38 +0000 (13:27 +0200)
committerJonas Dreßler <verdre@v0yd.nl>
Wed, 26 Apr 2023 11:36:31 +0000 (13:36 +0200)
When the screencast dbus service crashes due to gstreamer, we should also
handle that and not pretend to continue recording.

Let's listen to g-name-owner changes for that and then also send a
notification about it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2752>

js/ui/screenshot.js

index d50a4f0460ad914170dfc0d2bb58139d5edaf47b..fa67ff2d7ce1ee5003b8b648bfedceb08d263850 100644 (file)
@@ -1040,6 +1040,16 @@ var ScreenshotUI = GObject.registerClass({
         this._screencastProxy.connectSignal('Error',
             () => this._screencastFailed());
 
+        this._screencastProxy.connect('notify::g-name-owner', () => {
+            if (this._screencastProxy.g_name_owner)
+                return;
+
+            if (!this._screencastInProgress)
+                return;
+
+            this._screencastFailed();
+        });
+
         this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
 
         // The full-screen screenshot has a separate container so that we can